Release 10.1A: OpenEdge Development:
Debugging and Troubleshooting
Event stack
An external event can result in more than one internal event. For example, clicking the mouse in a fill-in might shift the focus from another field, causing
ENTRYandLEAVEevents, respectively. Since the ordering of events is significant, OpenEdge builds a stack based on events as they occur, starting with the first event at the bottom of the stack. Each succeeding event is added to the stack.The stack is a LIFO (Last In First Out) stack, which means OpenEdge pushes events onto the stack in the reverse order of their firing. In the focus example above, clicking in the fill-in causes the focus to shift, so the
ENTRYevent is first in the stack.In some cases, a trigger on one event takes precedence over a trigger on another event. For example, when you click the mouse to choose a button, OpenEdge generates both a
MOUSE-SELECT-CLICKevent and aCHOOSEevent for the button (among other possible events). Since theMOUSE-SELECT-CLICKtrigger takes precedence over theCHOOSEtrigger for a button, OpenEdge recognizes that theCHOOSEtrigger should not fire and does not push it onto the stack.Sometimes OpenEdge has to insert an event elsewhere in the stack than at the top. For example, when you click the mouse to choose a button, OpenEdge pushes the
MOUSE-SELECT-DOWNandENTRYevents that are the first to occur, onto the stack. When you release the mouse button, aCHOOSEevent occurs, but if OpenEdge pushes theCHOOSEevent onto the top of the stack, aCHOOSEtrigger on the button will fire before anENTRYtrigger. Since anENTRYtrigger always must fire before aCHOOSEtrigger, OpenEdge inserts theCHOOSEevent below theENTRYevent so theCHOOSEtrigger will fire after theENTRYtrigger.Once it adds the events for an external action to the stack, OpenEdge starts to remove events. Since the stack is built in reverse order, the last event pushed onto the stack is the first to be removed. As it removes each event, OpenEdge checks for triggers and runs the 4GL code for each event trigger it finds.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |